{
  "cells": [
   {
    "cell_type": "code",
    "execution_count": 1,
    "metadata": {},
    "outputs": [
     {
      "name": "stderr",
      "output_type": "stream",
      "text": [
       "/Users/aleksandrbobrov/data/rag/langfun/.venv/lib/python3.12/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
       "  from .autonotebook import tqdm as notebook_tqdm\n"
      ]
     }
    ],
    "source": [
     "import langfun as lf\n",
     "import os"
    ]
   },
   {
    "cell_type": "code",
    "execution_count": 6,
    "metadata": {},
    "outputs": [
     {
      "name": "stdout",
      "output_type": "stream",
      "text": [
       "The capital of France is **Paris**.\n"
      ]
     }
    ],
    "source": [
     "\n",
     "lf_llm = lf.llms.AzureOpenAI(\n",
     "    model='gpt-4o',\n",
     "    deployment_name='gpt-4o',\n",
     "    api_version=os.getenv('OPENAI_API_VERSION', '2024-08-01-preview'),\n",
     "    azure_endpoint=os.getenv('AZURE_OPENAI_ENDPOINT'),\n",
     "    api_key=os.getenv('AZURE_OPENAI_API_KEY'),\n",
     "    #debug=false,\n",
     "    temperature=0.0,\n",
     ")\n",
     "response = lf.query(prompt=\"What is the capital of France?\", lm=lf_llm)\n",
     "print(response)"
    ]
   }
  ],
  "metadata": {
   "kernelspec": {
    "display_name": ".venv",
    "language": "python",
    "name": "python3"
   },
   "language_info": {
    "codemirror_mode": {
     "name": "ipython",
     "version": 3
    },
    "file_extension": ".py",
    "mimetype": "text/x-python",
    "name": "python",
    "nbconvert_exporter": "python",
    "pygments_lexer": "ipython3",
    "version": "3.12.8"
   }
  },
  "nbformat": 4,
  "nbformat_minor": 2
 }